package org.codefinger.dao.impl.sql;

import org.codefinger.dao.impl.SQLVisitor;
import org.codefinger.dao.util.Lang;

public class UValueItem {

	private String		uPreffix;

	private Expression	exp;

	public UValueItem(String name, Expression exp, boolean first) {
		super();
		if (first) {
			this.uPreffix = Lang.joinStr(name.length() + 8, " SET ", name, " = ");
		} else {
			this.uPreffix = Lang.joinStr(name.length() + 4, ",", name, " = ");
		}
		this.exp = exp;
	}

	public void visit(SQLVisitor visitor) {
		visitor.appendSQL(uPreffix);
		exp.visit(visitor);
	}

}
